<?php

namespace App\Services;

use App\Models\SocialAccount;

class SocialAccountService extends Service
{
    public function createFromWechatAuthorizer($authorizer)
    {
        $authorizer['gender'] = $authorizer['sex'];
        return SocialAccount::create($authorizer);
    }

    public function getByOpenId($openid)
    {
        return SocialAccount::where('openid', $openid)->first();
    }
}